package com.wiscamp.ninechapters.problems.application.assemblers;

import com.wiscamp.ninechapters.problems.application.dto.commands.collections.CreateCollectionPartCommand;
import com.wiscamp.ninechapters.problems.application.dto.commands.collections.CreateCollectionSectionCommand;
import com.wiscamp.ninechapters.problems.application.dto.commands.collections.UpdateCollectionPartCommand;
import com.wiscamp.ninechapters.problems.application.dto.commands.collections.UpdateCollectionSectionCommand;
import com.wiscamp.ninechapters.problems.application.dto.vo.collections.CollectionPartVO;
import com.wiscamp.ninechapters.problems.application.dto.vo.collections.ColllectionSectionVO;
import com.wiscamp.ninechapters.problems.domain.models.collections.CollectionPart;
import com.wiscamp.ninechapters.problems.domain.models.collections.CollectionSection;
import org.mapstruct.Mapper;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface CollectionPartAssembler {
    CollectionPartAssembler Instance = Mappers.getMapper(CollectionPartAssembler.class);

    // region part
    CollectionPartVO toCollectionPartVO(CollectionPart entity);

    CollectionPart fromCreateCommand(CreateCollectionPartCommand command);

    CollectionPart fromUpdateCommand(UpdateCollectionPartCommand command);
    // endregion


    // region section
    ColllectionSectionVO toCollectionSectionVO(CollectionSection entity);

    CollectionSection fromCreateCommand(CreateCollectionSectionCommand command);

    CollectionSection fromUpdateCommand(UpdateCollectionSectionCommand command);
    // endregion
}
